function [Val,V]=Fun_V(PP,SS,T,Profit,TAU,ir,w,UCoefp,State,Flag_SS)
% T=SS.T;Profit=SS.Profit;ir_dom=SS.ir_dom;ir_ext=SS.ir_ext;Pir=SS.Pir;
% w_N=SS.w_N;w_H=SS.w_H;State=SS.FunApp.V.State;TAU=SS.TAU;UCoefp=UCoef_0;
if nargin<=9
    Flag_SS     =   0;
end
%% Preliminary
% States
N_State     =   size(State,1);
f           =   State(:,1);
ID          =   State(:,2);

ID_z        =   SS.FunApp.ExoState.State(ID,1);

z           =   PP.ExoState.IdioInc.Node(ID_z);

what        =   (1-TAU)*w;
ret         =   ir;

% Boundary for bp Imposed by Approximation Structure
fp_lb       =   SS.FunApp.U.UnitLimit(1,1);
fp_ub       =   SS.FunApp.U.UnitLimit(1,2);
% Important Constant
wN_SS       =   SS.w*SS.N;
x           =   T+Profit*z+f;

%% Determine the Potential UI
% Maximium Available Expenditure
b_lb        =   max(fp_lb./(1+ret+PP.KAPPA*(fp_lb<0)),PP.b_lb);
b_ub        =   max(fp_ub./(1+ret+PP.KAPPA*(fp_ub<0)),b_lb);
MaxExp      =   x-b_lb;
% Minimum Required Expenditure
[~,MinExp,~]=   UtilityFlow_Sep(PP.NU_C,PP.NU_L,SS.PSI,z.*what,PP.MinCon*wN_SS,'Consumption');
MinExp      =   MinExp/wN_SS;
% Required UI Benefit
UI          =   (1+PP.UI_Slack)*max(MinExp-MaxExp,0);


%% Optimization
% Effective State: Available Wealth (x=c+f)
x           =   x+UI;
% Boundary 
Exp_lb      =   max(x-b_ub,MinExp);
Exp_ub      =   max(x-b_lb,Exp_lb);

[~,c_lb,~]  =   UtilityFlow_Sep(PP.NU_C,PP.NU_L,SS.PSI,z.*what,Exp_lb*wN_SS,'Expenditure');
[~,c_ub,~]  =   UtilityFlow_Sep(PP.NU_C,PP.NU_L,SS.PSI,z.*what,Exp_ub*wN_SS,'Expenditure');

c_lb        =   c_lb/wN_SS;
c_ub        =   c_ub/wN_SS;

% Optimization
TempFun     =   @(Policy,State) ...
                Fun_V_Eval(PP,SS,UCoefp,State,Policy,0);
TempState   =   [x,ID,repmat([ret,what],[N_State,1])];
[Opt_c,~]   =   VecFun_GoldenSearch(TempFun,TempState,c_lb,c_ub,1e-6);
  
[Val,V]     =   Fun_V_Eval(PP,SS,UCoefp,TempState,Opt_c,Flag_SS);
%% Collect the Extra Policy
V.Policy.FlagBC ...
            =   (V.Policy.b-b_lb)<1e-6;
V.Policy.UI =   UI;
V.Policy.FlagUI ...
            =   UI>0;